home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh -e
- #
- # $Id: dhcp3-client.postinst,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
- #
-
- # Source debconf library.
- . /usr/share/debconf/confmodule
-
- # Remove a no-longer used conffile
- rm_conffile()
- {
- CONFFILE="$1"
-
- if [ -e "$CONFFILE".dpkg-obsolete ]; then
- echo "Removing obsolete conffile $CONFFILE"
- rm -f "$CONFFILE".dpkg-obsolete
- fi
- }
-
- case "$1" in
- configure)
- if [ ! -e /var/lib/dhcp3/dhclient.leases ]; then
- if test -e /var/lib/dhcp/dhclient.leases; then
- cp /var/lib/dhcp/dhclient.leases /var/lib/dhcp3/dhclient.leases
- else
- touch /var/lib/dhcp3/dhclient.leases
- fi
- fi
-
- if dpkg --compare-versions "$2" lt-nl "3.0.4-2"; then
- if [ -e /etc/dhcp3/dhclient-script ]; then
- db_input high dhcp3-client/dhclient-script_moved || true
- db_go
- else
- db_input high dhcp3-client/dhclient-needs-restarting || true
- db_go
- fi
- fi
-
- if [ -e /etc/dhcp3/dhclient.conf.oldconfig ]; then
- mv /etc/dhcp3/dhclient.conf.oldconfig /etc/dhcp3/dhclient.conf
- fi
-
- # Reload AppArmor profile
- profile="/etc/apparmor.d/sbin.dhclient3"
- if [ -f "$profile" ] && aa-status --enabled 2>/dev/null; then
- apparmor_parser -r "$profile" || true
- fi
-
- if dpkg --compare-versions "$2" lt-nl 3.1.2-1ubuntu7; then
- rm_conffile /etc/network/if-pre-up.d/dhclient3-apparmor
- fi
- ;;
-
- abort-upgrade|abort-remove|abort-deconfigure)
- exit 0
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 0
- ;;
- esac
-
-
-